﻿using MongoDB.Bson.Serialization.Serializers;
using System;
using System.Collections.Generic;
using System.Net;
namespace HBase
{
    public abstract class ZtTaskConnect : ZtTask, ConnIp {

        public string ip;
        public int port;
        protected IPEndPoint ipEndPoint;
        public ZtTaskConnect() : base()
        {
            time = 3000;
        }

        protected string[] ports;
        public override bool excute()
        {
            bool re = reConnect();

            return re;
        }

        protected abstract bool reConnect();
        protected override bool init()
        {
            base.init();
            string[] para = p.Split(':');
            ip = para[0];
            port = int.Parse(para[1]);
            IPAddress addr = IPAddress.Parse(para[0]);
            ipEndPoint = new IPEndPoint(addr, int.Parse(para[1]));
            return true;
        }
    }
}
